﻿using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZyGames.Framework.Model;

namespace ZyGames.DZPocker.Model
{
	/// <summary>
	/// 桌子上的牌
	/// </summary>
	[Serializable, ProtoContract]
	[EntityTable(CacheType.Dictionary, DbConfig.Data)]
	public class GameTableCards : BaseEntity
	{
		public GameTableCards()
			: base(false)
		{
		}
		public GameTableCards(int id, int savedUserId, int tableId, int card0, int card1, int card2, int card3, int card4)
			: this()
		{
			this.ID = id;
			this.SavedUserID = savedUserId;
			this.TableID = tableId;
			this.Card0 = card0;
			this.Card1 = card1;
			this.Card2 = card2;
			this.Card3 = card3;
			this.Card4 = card4;
		}

		[ProtoMember(1)]
		[EntityField(true)]
		public int ID { get; set; }

		/// <summary>
		/// 保存的玩家ID
		/// </summary>
		[ProtoMember(2)]
		[EntityField]
		public int SavedUserID { get; set; }

		/// <summary>
		/// 桌子的逻辑Id
		/// </summary>        
		[ProtoMember(3)]
		[EntityField]
		public int TableID { get; set; }

		/// <summary>
		/// 第几手牌
		/// </summary>        
		[ProtoMember(4)]
		[EntityField]
		public int Hand { get; set; }

		/// <summary>
		/// 手牌0
		/// </summary>        
		[ProtoMember(5)]
		[EntityField]
		public int Card0 { get; set; }
      
		[ProtoMember(6)]
		[EntityField]
		public int Card1 { get; set; }
      
		[ProtoMember(7)]
		[EntityField]
		public int Card2 { get; set; }

		[ProtoMember(8)]
		[EntityField]
		public int Card3 { get; set; }


		[ProtoMember(9)]
		[EntityField]
		public int Card4 { get; set; }

		protected override int GetIdentityId()
		{
			return ID;
		}
	}
}
